package com.dynamic.model.util.common;

import java.util.List;

import com.dynamic.model.model.po.SysmanUser;
import com.dynamic.model.service.SystemUserService;
import org.springframework.web.context.ContextLoader;

public class SysmanUserServiceUtil {
	
	private static SystemUserService sysmanUserService;

	public static SystemUserService getService() {

		if (sysmanUserService == null) {

			synchronized (SysmanUserServiceUtil.class) {

				if (sysmanUserService == null) {

					sysmanUserService = ContextLoader
							.getCurrentWebApplicationContext().getBean(
									SystemUserService.class);

				}
			}
		}

		return sysmanUserService;

	}
	
	public static List<SysmanUser>  getAll(){
		return getService().getAll() ;
	}
	
	public static SysmanUser findByName(String username){
		return getService().findByName(username);
	}
}
